package com.game.server.message.proto.execute;

import com.comm.ISession;
import com.game.majiang.logic.LogicClient;
import com.game.majiang.logic.LogicServer;
import com.game.majiang.logic.LogicTable;
import com.game.server.message.proto.in.AbstractRuzuoReq;

public class RuzuoReq extends AbstractRuzuoReq {

    @Override
    public void Execute(ISession session) {
        LogicClient client = (LogicClient) LogicServer.getInstance().getClient(session.getId());
        if (client != null&&client.checkClick(msgcode)) {
            LogicTable table = (LogicTable) client.getTable();
            if(table != null) {
            	if(this.type.intValue() == 0) {
            		table.sitDown(client, this.seatNo);
            	} else if(this.type.intValue() == 1) {
            		table.standUp(client);
            	} else if(this.type.intValue() == 2) {
            		table.reservedSeat(client, this.seatNo);
            	} else if(this.type.intValue() == 3) {
            		table.returnToSeat(client);
            	}
            }
        }
    }

}
